package com.example.imtoken.modules.user.create.backups.mnemonic

import androidx.lifecycle.MutableLiveData
import com.example.imtoken.core.App
import com.example.imtoken.core.base.BaseViewModel

class MnemonicWordsViewModel : BaseViewModel() {

    val wordsLiveData = MutableLiveData<List<String>>()

    fun initWords(value: String?) {
        var mnemonics = value ?: (//获取助记词
                App.newCreateData?.coin?.mnemonic ?: App.createLiveData.value?.coin?.mnemonic)
        //将助记词分割
        val list = mnemonics?.split(" ")
        wordsLiveData.value = list
    }

}